package com.microservice.base.mapper.hikcommon;

import com.microservice.base.entity.InfoStudent;
import com.microservice.base.entity.InfoTeacher;
import com.microservice.base.mapper.BaseMP;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 学生档案信息
 *
 * @author abin
 * @email chcbup@163.com
 * @date 2017-08-31 17:55:51
 */
public interface InfoStudentMP extends BaseMP<InfoStudent> {
  // 保存之前的查询
  int selectBeforeSave(Map<String, Object> map);

  InfoStudent getStudentByexanNumber(String exanNumber);

  List<InfoStudent> queryStudentByIdNoOrCode(
      @Param("idNo") String idNo,
      @Param("userCode") String userCode,
      @Param("schoolCode") String schoolCode);

  /**
   * 查找shortcode is null 的学生
   *
   * @return
   */
  List<InfoStudent> queryShortcodeIsNull();

  @Override
  void save(InfoStudent infoStudent);

  @Override
  int update(InfoStudent infoStudent);

  void updateStudent(InfoStudent infoStudent);

  @Override
  void delete(String id);

  List<InfoStudent> getStudentByPlaceId(
      @Param("schoolCode") String schoolCode, @Param("placeId") String placeId);

  int getcountbyschool(
      @Param("schoolCode") String schoolCode,
      @Param("gradeId") String gradeId,
      @Param("classId") String classId);

  int getCountByAttendingType(
      @Param("schoolCode") String schoolCode,
      @Param("attendingType") String attendingType,
      @Param("gradeId") String gradeId,
      @Param("classId") String classId);

  List<InfoStudent> getStudentBySchoolCode(String schoolCode);

  List<InfoStudent> queryStudentByLoginName(String loginName, String schoolCode);

  void updateBatch(List<InfoStudent> infoStudentList);

  // 根据classId 获取该班级下的学生走读方式
  List<Map<String, Object>> queryAttendList(Map<String, Object> map);

  // 批量修改学生走读类型
  void updateSudentAttendType(List<InfoStudent> list);

  void saveStudent(InfoStudent infoStudent);

  void updateSync(String syncFlag);

  @Override
  List<InfoStudent> queryAll();

  List<InfoStudent> QueryUserTreeBySyncFlag(String syncFlag);

  void replace(List<InfoStudent> student);
}
